<template>
    <div id="show">
        <p>id: {{info.id}}</p>
        <p>name: {{info.name}}</p>
        <p>city_text:{{info.city_text}}</p>
    </div>
</template>

<script>
export default {
  data () {
    return {
      loading: false,
      info: [],
      error: null
    }
  },
  created () {
    this.fetchData()
  },
  watch: {
    '$route': 'fetchData'
  },
  methods: {
    fetchData () {
      this.error = null
      this.loading = true
      this.axios.get('https://oa.fc62.com/api/school/show/id/' + this.$route.params.id).then(response => {
        console.log(response.data)
        this.info = response.data.data
      })
    }
  }
}
</script>
